/*
 * Copyright (c) 2017 深圳市高德威技术有限公司  All rights reserved.
 *
 * message_queue.h
 *
 *  Created on: 2017年4月6日
 *      Author: chenshisheng
 */

#ifndef MESSAGE_QUEUE_H_
#define MESSAGE_QUEUE_H_

#include "main.h"

#define MSGQUEUE_MSG_MAX_SIZE  64

typedef enum
{
    MsgQueue_Id_ShellLineIn = 0,
    MsgQueue_Id_CtimerFire,
    MsgQueue_Id_IoUpdate,
    MsgQueue_Id_IoDevChange,
    MsgQueue_Id_Vibration,
    MsgQueue_Id_IoNotyfyRemote,
    MsgQueue_Id_IntPrint,
    MsgQueue_Id_WatchDogReset,
    MsgQueue_Id_Monitor,
}MsgQueue_Id_t;

typedef struct
{
    MsgQueue_Id_t id;
    unsigned int size;
    uint8_t data[MSGQUEUE_MSG_MAX_SIZE];
}MsgQueue_Msg_t;

typedef void (* MsgQueue_Notify_t)(MsgQueue_Msg_t *msg);

void MsgQueue_Init(MsgQueue_Notify_t globalNotify);
int MsgQueue_Send(MsgQueue_Id_t id, const void *dataIn, unsigned int size);
void MsgQueue_Service(void);

#endif /* MESSAGE_QUEUE_H_ */
